using System;
using System.Text;
using System.Xml;   

using QuoteAdvantage.CrmSdk;

namespace QuoteAdvantage
{
	/// <summary>
	/// Summary description for Product.
	/// </summary>
	public class ProductPriceLevel
	{
      private Guid      m_guidPriceLevelId;
      private Guid      m_guidProductId;
      private Decimal   m_nAmount;

		public ProductPriceLevel()
		{
			
		}

      
      public Decimal Amount
      {
         get { return m_nAmount;}
         set { m_nAmount = value;}
      }

      public Guid ProductId
      {
         get { return m_guidProductId;}
         set { m_guidProductId = value;}
      }
      
      public Guid PriceLevelId
      {
         get { return m_guidPriceLevelId;}
         set { m_guidPriceLevelId = value;}
      }

      public ProductPriceLevel Clone()
      {
         ProductPriceLevel  objNewPrice = new ProductPriceLevel();

         objNewPrice.Amount = m_nAmount;  
         objNewPrice.ProductId = m_guidProductId;
         objNewPrice.PriceLevelId = m_guidPriceLevelId;
 
         return objNewPrice;
      }
        
      public void LoadFromCrmPriceLevel(productpricelevel objCrmPriceLevel)
      {
         if (objCrmPriceLevel.amount == null)
         {
            this.Amount = 0;
         }
         else
         {
            this.Amount = objCrmPriceLevel.amount.Value;
         }

         this.PriceLevelId = objCrmPriceLevel.pricelevelid.Value;
         this.ProductId = objCrmPriceLevel.productid.Value;
      }    


	} // end class
}
